Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gae): add gae_search prefix to all regions tags #5088

Conversation

OremGLG
Copy link
Contributor

@OremGLG OremGLG commented Jan 15, 2025

Description

In order to associate region tags to official GCP products PR adds "gae_search" prefix to all regions

Fixes b/389069998

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed Contributing Guidelines from CONTRIBUTING.MD
  • Tests pass: go test -v ./.. (see Testing)
  • Code formatted: gofmt (see Formatting)
  • Vetting pass: go vet (see Formatting)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jan 15, 2025
Copy link

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @OremGLG and reviewers,

I'm currently reviewing this pull request and will provide my feedback in a few minutes. In the meantime, here's a summary of the changes for you and other reviewers to quickly get up to speed:

This pull request aims to fix issue b/389069998 by adding the gae_search prefix to all region tags in the golang-samples repository. This is to ensure proper association of region tags with official GCP products.

The changes involve modifying the search.go file within the docs/appengine/search directory. Specifically:

  • All comment tags related to App Engine search have been updated to include the gae_search prefix. For example, // [START creating_a_document] became // [START gae_search_creating_a_document]. This change is consistent across multiple code sections within the file, affecting lines:
    • 17
    • 46
    • 63
    • 75
    • 94
    • 115
    • 142
    • 148
    • 152
    • 156

Here's a table summarizing the changes:

Original Tag New Tag Line Number(s)
[START creating_a_document] [START gae_search_creating_a_document] 17
[END creating_a_document] [END gae_search_creating_a_document] 46
[START putting_documents_in_an_index_1] [START gae_search_putting_documents_in_an_index_1] 48, 63
[END putting_documents_in_an_index_1] [END gae_search_putting_documents_in_an_index_1] 63
[START putting_documents_in_an_index_2] [START gae_search_putting_documents_in_an_index_2] 65
[END putting_documents_in_an_index_2] [END gae_search_putting_documents_in_an_index_2] 72
[START retrieving_documents_by_doc_ids] [START gae_search_retrieving_documents_by_doc_ids] 75
[END retrieving_documents_by_doc_ids] [END gae_search_retrieving_documents_by_doc_ids] 94
[START deleting_documents_from_an_index] [START gae_search_deleting_documents_from_an_index] 96
[END deleting_documents_from_an_index] [END gae_search_deleting_documents_from_an_index] 115
[START search_example_1] [START gae_search_search_example_1] 119
[END search_example_1] [END gae_search_search_example_1] 142
[START queries_1] [START gae_search_queries_1] 148
[END queries_1] [END gae_search_queries_1] 150
[START queries_2] [START gae_search_queries_2] 152
[END queries_2] [END gae_search_queries_2] 154
[START queries_3] [START gae_search_queries_3] 156
[END queries_3] [END gae_search_queries_3] 158

The author has indicated that tests pass and code is formatted correctly.

Let's keep the code clean,
Prefixes add their sheen.
Fixes bugs with grace,
Happy coding, keep the pace!

Copy link

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request adds the gae_search prefix to region tags in the search.go file. This change effectively associates the region tags with the official GCP product, Google App Engine Search. The change is small and straightforward, directly addressing the issue described.

@@ -43,9 +43,9 @@ func putHandler(w http.ResponseWriter, r *http.Request) {
Birthday: time.Date(1960, time.June, 19, 0, 0, 0, 0, nil),
}
// ...
// [END creating_a_document]
// [END gae_search_creating_a_document]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_creating_a_document]
// [END gae_search_creating_a_document]


// [START putting_documents_in_an_index_1]
// [START gae_search_putting_documents_in_an_index_1]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [START gae_search_putting_documents_in_an_index_1]
// [START gae_search_putting_documents_in_an_index_1]

@@ -60,19 +60,19 @@
}
fmt.Fprint(w, "OK")

// [END putting_documents_in_an_index_1]
// [END gae_search_putting_documents_in_an_index_1]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_putting_documents_in_an_index_1]
// [END gae_search_putting_documents_in_an_index_1]


// [START putting_documents_in_an_index_2]
// [START gae_search_putting_documents_in_an_index_2]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [START gae_search_putting_documents_in_an_index_2]
// [START gae_search_putting_documents_in_an_index_2]

id, err = index.Put(ctx, "", user)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
fmt.Fprint(w, id)
// [END putting_documents_in_an_index_2]
// [END gae_search_putting_documents_in_an_index_2]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_putting_documents_in_an_index_2]
// [END gae_search_putting_documents_in_an_index_2]

index.Search(ctx, "rose water", nil)
// [END queries_1]
// [END gae_search_queries_1]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_queries_1]
// [END gae_search_queries_1]


// [START queries_2]
// [START gae_search_queries_2]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [START gae_search_queries_2]
// [START gae_search_queries_2]

index.Search(ctx, "1776-07-04", nil)
// [END queries_2]
// [END gae_search_queries_2]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_queries_2]
// [END gae_search_queries_2]


// [START queries_3]
// [START gae_search_queries_3]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [START gae_search_queries_3]
// [START gae_search_queries_3]

// search for documents with pianos that cost less than $5000
index.Search(ctx, "Product = piano AND Price < 5000", nil)
// [END queries_3]
// [END gae_search_queries_3]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

Added gae_search prefix.

Suggested change
// [END gae_search_queries_3]
// [END gae_search_queries_3]

@OremGLG OremGLG marked this pull request as ready for review January 15, 2025 22:22
@OremGLG OremGLG requested review from a team as code owners January 15, 2025 22:22
Copy link

snippet-bot bot commented Jan 15, 2025

Here is the summary of changes.

You are about to add 9 region tags.
You are about to delete 9 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
/~https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@telpirion telpirion self-assigned this Jan 16, 2025
Copy link
Collaborator

@telpirion telpirion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that the relevant documentation on cloud.google.com is updated.

@OremGLG
Copy link
Contributor Author

OremGLG commented Jan 17, 2025

It is a frozen sample, according to @iennae "Migrate the region tag in the 'main' branch, but don't update frozen samples in those cases

Eg: GoogleCloudPlatform/python-docs-samples#13047

That's why I am not updating documentation.

@telpirion telpirion merged commit 0251f91 into GoogleCloudPlatform:main Jan 21, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants